﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Text;
using System.Windows.Forms;
using System.Threading;
using FlexLib.Plugins;

namespace PackageEditor
{
	public partial class BuildProgressForm : Form
	{		
		public BuildProgressForm()
		{
			InitializeComponent();
			progressBar.Minimum = 0;
			progressBar.Maximum = 100;
			progressBar.Value = 0;
		}

		public void DoProgress(int percent, string message)
		{
			if (this.InvokeRequired)
			{
				this.BeginInvoke(new InstPackage.LogProgressHandler(this.DoProgress),
					new object[] { percent, message });
				return;
			}
			if (percent != 0)
				progressBar.Value = percent;
			label1.Text = "Building: " + percent + "%";
			message += '\n';
			logBox.Text += message;
			logBox.SelectionStart = logBox.Text.Length;
			logBox.SelectionLength = 0;
			logBox.ScrollToCaret();
		}

		private void tableLayoutPanel3_Paint(object sender, PaintEventArgs e)
		{

		}
	}
}
